from config.all_paths import config_variable_path
from config.global_variable import FG
from utils.file_handling.txt_handling import extract_txt


def FGDataProcessing(data, res):
    """
    非公数据处理
    """
    # 获取非公数据统计
    if data.get('case_name') == '非公数据统计':
        totalCount = str(res.json()['data']['totalCount'])
        FG['totalCount'] = totalCount
        childCount = str(res.json()['data']['childCount'])
        FG['childCount'] = childCount
        totalPaid = str(res.json()['data']['totalPaid'])
        FG['totalPaid'] = totalPaid
        endedCount = str(res.json()['data']['endedCount'])
        FG['endedCount'] = endedCount
        runningCount = str(res.json()['data']['runningCount'])
        FG['runningCount'] = runningCount

        extract_txt(config_variable_path, str(FG))

